#include "comm.hpp"

int main()
{
    int shmid = GetShm();
    char* shmaddr = (char*)shmat(shmid, nullptr, 0);

    int fd = open(FIFO_FILE, O_WRONLY|O_APPEND);
    if (fd < 0)
    {
        log(Fatal, "open error: %s", strerror(errno));
        exit(FIFO_OPEN_ERR);
    }

    while (true)
    {
        cout << "Please Enter@ ";
        fgets(shmaddr, 4096, stdin);
        write(fd, "c", 1);
    }

    shmdt(shmaddr);
    close(fd);
    return 0;
}